package com.ld.security.auth.common.sys.service.impl;


import com.ld.security.auth.common.sys.entity.SysRoleEntity;
import com.ld.security.auth.common.sys.login.UserService;
import com.ld.security.auth.common.sys.service.ISysRoleService;
import com.ld.security.common.mybatis.base.service.ISuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;

@Service
@Transactional
public class SysRoleServiceImpl  extends ISuperServiceImpl<SysRoleEntity>
implements
        ISysRoleService {

        @Autowired
        UserService userService;

        @Override
        public int save(SysRoleEntity entity) {

                int total = super.save(entity);;

                userService.flushAll();

                return total;
        }

        @Override
        public int removeByIds(Collection<String> ids) {
                int total =  super.removeByIds(ids);
                userService.flushAll();
                return total;
        }
}
